and an example with classification
*Computer vision is an essential, complex, wide-spread, and ever developing part of AI. Computer vision tasks include:
Image of 1300 X 1300px --> Input on a layer of a FC (Dense) network with e.g. 1000 hidden units -->
parameters (weights) to calculate : (1000,1300x1300) = 1.69E9 parameters (x3 for a color image)




(edge detectors)
filter_v=np.array([[1,0,-1],[1,0,-1],[1,0,-1]]) # 3x3 vertical edges filter
filter_h=np.array([[1,1,1],[0,0,0],[-1,-1,-1]]) # 3x3 horizontal edges filter
filter_v_3d=np.dstack([filter_v]*3) # 3x3x3 vertical edges filter
filter_h_3d=np.dstack([filter_h]*3) # 3x3x3 horizontal edges filter
image = Image.open('brick2.jpeg').convert('L')
brick = asarray(image)
plt.figure(figsize=(10,10))
plt.imshow(brick,cmap='gray')
plt.axis('off')
plt.show()
out_conv_h=signal.convolve2d(brick,filter_h,mode='valid')
out_conv_v=signal.convolve2d(brick,filter_v,mode='valid')
f, axarr = plt.subplots(1,2,figsize = (50,50))
axarr[0].imshow(np.absolute(out_conv_h),cmap='gray')
axarr[0].set_axis_off()
axarr[1].imshow(np.absolute(out_conv_v),cmap='gray')
axarr[1].set_axis_off()
plt.show()
image = Image.open('brick.jpeg')
brick = asarray(image)
plt.figure(figsize=(10,10))
plt.imshow(brick)
plt.axis('off')
plt.show()
out_corr_v=signal.correlate(brick,filter_v_3d,mode='valid')
out_corr_h=signal.correlate(brick,filter_h_3d,mode='valid')
f, axarr = plt.subplots(1,2,figsize = (50,50))
axarr[0].imshow(np.absolute(out_corr_h),cmap='seismic')
axarr[0].set_axis_off()
axarr[1].imshow(np.absolute(out_corr_v),cmap='seismic')
axarr[1].set_axis_off()
plt.show()











The building blocks (i.e. most commonly used types of layers in CNNs)


Conv Layer
Conv Block
Simle Conv Net
Classification/Regression
Dropout: A Simple Way to Prevent Neural Networks from Overfitting, JMLR (2014) http://jmlr.org/papers/v15/srivastava14a.html

Augmenting the training dataset, by applying transformations to existing data (images in this case): flip, rotate, shear, shift, zoom, color distortion, etc.

